"""
range 可迭代对象
语法(start,end,step)
start:开始数(默认是0)
end:结束数(不包括)
step:步长(默认1)
"""

#  range(0,10)  -> [0,1,2,3...9]
for i in range(10):
    print(i)

# for实现1到100的和
sum = 0
for i in range(1,101):
    sum += i
print(sum)

# for实现1到100之间的偶数和
sum = 0
for i in range(0,101,2):
    sum += i
print(sum)

# for实现1到100之间的奇数和
sum = 0
for i in range(1,100,2):
    sum += i
print(sum)